<?php

//登陆
Route::prefix('admin')->namespace('admin')->group(function () {
	Route::get('/login', 'LoginController@index');//登陆页面
	Route::post('/login', 'LoginController@login');//登陆操作
	Route::get('/logout', 'LoginController@logout');//登出
});

Route::prefix('admin')->namespace('admin')->middleware(['admin.login', 'admin.auth'])->group(function () {
	Route::get('/', 'IndexController@index');
	Route::get('/index', 'IndexController@index');//后台首页
	Route::get('/home', 'IndexController@home');
	Route::get('/menus', 'IndexController@getMenu');//侧边栏菜单
	//后台用户模块
	Route::prefix('admin')->group(function () {
		Route::any('/', 'AdminController@index');//列表
		Route::get('/detail', 'AdminController@detail');//详细信息
		Route::get('/add', 'AdminController@add');//添加页面
		Route::post('/add', 'AdminController@addStore');//保存添加
		Route::get('/edit', 'AdminController@edit');//修改页面
		Route::post('/edit', 'AdminController@editStore');//保存修改
		Route::get('/status', 'AdminController@changeStatus');//修改状态
		Route::get('/role', 'AdminController@role');//用户角色页面
		Route::post('/role', 'AdminController@roleStore');//用户角色保存
		Route::get('/roleInfo', 'AdminController@roleInfo');//用户角色信息
		Route::any('/record', 'AdminController@loginRecord');//登陆记录
	});
	//会员模块
	Route::prefix('user')->group(function () {
		Route::any('/', 'UserController@index');//列表
		Route::get('/add', 'UserController@add');//添加
		Route::post('/add', 'UserController@addStore');
		Route::get('/edit', 'UserController@edit');//编辑
		Route::post('/edit', 'UserController@editStore');
		Route::post('/status', 'UserController@status');//状态修改
		Route::get('/detail', 'UserController@detail');//详情
		Route::any('/record', 'UserController@loginRecord');//登陆记录
		Route::get('/selectList', 'UserController@selectList');//下拉框列表
	});
	//菜单模块
	Route::prefix('menu')->group(function () {
		Route::any('/', 'MenuController@index');//角色列表
		Route::get('/detail', 'MenuController@detail');//详细信息
		Route::get('/selectList', 'MenuController@selectList');//下拉框列表
		Route::get('/add', 'MenuController@add');//添加页面
		Route::post('/add', 'MenuController@addStore');//保存添加
		Route::get('/edit', 'MenuController@edit');//修改页面
		Route::post('/edit', 'MenuController@editStore');//保存修改
		Route::get('/status', 'MenuController@changeStatus');//修改状态
		Route::get('/sort', 'MenuController@changeSort');//修改排序
		Route::get('/menu', 'MenuController@changeMenu');//修改是否菜单
		Route::get('/check', 'MenuController@changeCheck');//修改是否权限检查
	});
	//角色模块
	Route::prefix('role')->group(function () {
		Route::any('/', 'RoleController@index');//角色列表
		Route::get('/detail', 'RoleController@detail');//详细信息
		Route::get('/selectList', 'RoleController@selectList');//下拉框列表
		Route::get('/add', 'RoleController@add');//添加页面
		Route::post('/add', 'RoleController@addStore');//保存添加
		Route::get('/edit', 'RoleController@edit');//修改页面
		Route::post('/edit', 'RoleController@editStore');//保存修改
		Route::get('/status', 'RoleController@changeStatus');//修改状态
		Route::get('/menu', 'RoleController@menu');//权限设置页面
		Route::post('/menu', 'RoleController@menuStore');//保存权限设置
		Route::get('/menuList', 'RoleController@menuList');//角色权限列表
	});
	//竞彩模块
	Route::prefix('lottery')->group(function () {
		Route::any('/', 'LotteryController@index');//比赛列表
		Route::get('/updateMatch', 'LotteryController@updateMatch');//更新比赛数据
		Route::get('/updateMatchResult', 'LotteryController@updateMatchResult');//更新比赛结果数据
		Route::get('/add', 'LotteryController@add');//添加比赛
		Route::post('/add', 'LotteryController@addStore');
		Route::get('/edit', 'LotteryController@edit');//编辑比赛
		Route::post('/edit', 'LotteryController@editStore');
		Route::get('/detail', 'LotteryController@getMatchDetail');//比赛详情
		Route::get('/match', 'LotteryController@getMatch');//比赛详情,从缓存中获取
		Route::post('/setScore', 'LotteryController@setScore');//设置比赛比分（未完成的比赛）
		Route::post('/status', 'LotteryController@setStatus');//比赛状态，（删除、腰斩）

		Route::any('/league', 'LeagueController@index');//联赛列表
		Route::get('/league/add', 'LeagueController@add');//添加联赛
		Route::post('/league/add', 'LeagueController@addStore');
		Route::get('/league/edit', 'LeagueController@edit');//编辑联赛
		Route::post('/league/edit', 'LeagueController@editStore');
		Route::get('/league/detail', 'LeagueController@detail');//联赛详情
		Route::get('/league/status', 'LeagueController@status');//联赛状态改变
		Route::get('/league/list', 'LeagueController@selectList');//联赛列表，用于下拉框

		Route::any('/record', 'LotteryRecordController@index');//推荐记录
		Route::any('/userRecord', 'LotteryRecordController@userRecords');//用户推荐记录
		Route::get('/record/add', 'LotteryRecordController@add');//添加推荐
		Route::post('/record/add', 'LotteryRecordController@addStore');
		Route::get('/record/edit', 'LotteryRecordController@edit');//编辑推荐
		Route::post('/record/edit', 'LotteryRecordController@editStore');
		Route::get('/record/detail', 'LotteryRecordController@getDetail');//详情

        Route::any('/pickUser','LotteryController@pickUser');//用户筛选
		Route::any('/recommend','LotteryController@recommendMatch');//比赛推荐

		Route::any('/statistic','LotteryRecordController@statistic');//推荐数据统计
	});

	//文章模块
	//文章标签
	Route::prefix('tag')->group(function () {
		Route::get('/', 'TagController@index');//标签列表
		Route::get('/detail', 'TagController@detail');//标签信息
		Route::get('/selectList', 'TagController@selectList');//标签下拉框列表
		Route::get('/add', 'TagController@add');//添加标签页面
		Route::post('/add', 'TagController@addStore');//保存添加标签
		Route::get('/edit', 'TagController@edit');//修改标签页面
		Route::post('/edit', 'TagController@editStore');//保存修改标签
		Route::get('/status', 'TagController@changeStatus');//修改状态
	});
	//文件上传
	Route::prefix('upload')->group(function () {
		Route::any('/image', 'UploadController@image');//图片上传
	});
});